﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
using FaymanController.Utils;
using Newtonsoft.Json;

namespace FaymanController
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            if (!File.Exists(Application.StartupPath + @"\conf.json"))
            {
                MessageBox.Show("您是第一次使用本软件，请先进行配置！", "Error",
                    MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                GlobalData.GlobalConfig = ConfigLoader.LoadConfig(Application.StartupPath + @"\conf.json");
                GlobalData.TimeTable = ConfigLoader.LoadTimeTable(Application.StartupPath + @"\table.json");
            }

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Main_Form());
        }
    }
}
